Build files are normally named .build
. This is the file EBuild looks
for when it is run.
The syntax of build files equals that of unix-make. In general, #
precedes
lines with comments, and:
target: dep1 dep2 ... action1 action2 ...
target
is the resulting file we're talking about, in most cases an
exe or module, but may be anything. Following the :
you write all
files that it depends upon, most notably its source, and other modules.
The actions on the following lines are normal AmigaDos commands, and need to be preceded by at least one space or tab to distinquish them from targets.
bla: bla.e defs.m ec bla quiet
This simple example will only recompile bla.e
if it was modified,
or if the defs.m
which it uses was modified.
If you type build
with no args, build will ensure the
first target in the file to be up to date.
A longer example:
# test build file all: bla burp defs.m: defs.e ec defs quiet bla: bla.e defs.m ec bla quiet burp: burp.e ec burp quiet clean: delete defs.m bla burp
This build file is about two programs, bla
and burp
, of which bla
also depends on a module defs.m
. An extra target clean
has
been added so you can type build clean
to delete all results. The
`clean' target is called a phony target or fake target
since it's not a real file.
The `all' target is a fake target, too. It's okay to have multiple fake targets, however, these cannot be used as dependancies.
Other dependencies and actions are easily added. For example, if your project uses a parser generated by E-Yacc:
yyparse.m: parser.y eyacc parser.y ec yyparse quiet
Or incorporates macro-assembly code as often used tool module:
blerk.m: blerk.s a68k blerk.s o2m blerk copy blerk.m emodules:tools flushcache tools/blerk
Go to the Next or Previous section or the Detailed Contents.